﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Content;
using EpsiRisk.MoteurJeu;

namespace EpsiRisk.AffichageJeu
{
    public class ClassZoneMiniMap : ClassZone
    {
        /// <summary>
        /// texture de la bordure
        /// </summary>
        static Texture2D SpriteBorder;

        static Texture2D SpriteDeplacement;
        static Texture2D SpriteCombat;
        static Texture2D SpriteRenforts;

        public ClassZoneMiniMap()
        {
            backcolor = Color.BurlyWood;
            position = new Vector2(0, 500);
            width = 100;
            height = 100;
        }

        internal override void initialiser(ContentManager content)
        {
            SpriteBorder = content.Load<Texture2D>("Sprites/SpriteBorderMenu");
            SpriteCombat = content.Load<Texture2D>("Sprites/phases/attaque");
            SpriteDeplacement = content.Load<Texture2D>("Sprites/phases/deplacement");
            SpriteRenforts = content.Load<Texture2D>("Sprites/phases/renforts");

        }
        internal override void Draw(SpriteBatch spriteBatch)
        {
            base.Draw(spriteBatch);
            spriteBatch.Begin();
            switch (ClassEtatPartie.phase)
            {
                case 0:
                    spriteBatch.Draw(SpriteRenforts, new Rectangle((int)position.X + 5, (int)position.Y + 15, 80, 80), Color.White);
                    break;
                case 1:
                    spriteBatch.Draw(SpriteCombat, new Rectangle((int)position.X + 5, (int)position.Y + 15, 80, 80), Color.White);
                    break;
                case 2:
                    spriteBatch.Draw(SpriteDeplacement, new Rectangle((int)position.X + 5, (int)position.Y + 15, 80, 80), Color.White);
                    break;
                case 3:
                    spriteBatch.Draw(SpriteRenforts, new Rectangle((int)position.X + 5, (int)position.Y + 15, 80, 80), Color.White);
                    break;
                default:
                    break;
            }
            spriteBatch.Draw(SpriteBorder, position + new Vector2(100, 0), null, Color.White, (float)Math.PI / 2, new Vector2(0, 0), 0.5f, SpriteEffects.None, 0);
            spriteBatch.End();
        }
    }
}
